import { service } from "./Request";
import qs from "qs";

const allApi = {
  cates() {
    return service({
      url: "/api/cates",
      method: "get"
    })
  },
  addCate(params) {
    return service({
      url: "/api/addproduct",
      method: "post",
      data: params
    })
  },
  editCate(params) {
    return service({
      url: `/api/updateproduct/${params[0]}`,
      method: "put",
      data: params[1]
    })
  },
  deleteCate(id) {
    return service({
      url: `/api/deleteproduct/${id}`,
      method: "delete"
    })
  },
  findCate(id) {
    return service({
      url: `/api/products/${id}`,
      method: "get"
    })
  },
};

export default allApi